Autor do projeto:

  • Fellipe Gomes (Statistics - UFF, Data Scientist - FGV IBRE / BRAZIL)

Se você gostou do Kernel não esqueça do upvote!

Carregar dependencias:

library(tidyverse)
library(DataExplorer)
library(knitr)
library(kableExtra)
library(caret)
library(patchwork)

theme_set(theme_bw())

kable2 <- function(x, width = "100%"){
  kable(x) %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive", "bordered"),
                full_width = F) %>%
  scroll_box(width = width, height = "300px")
}

1 Definica do Problema

A partir dos dados disponibilizados pela comunidade DataHackers é possivel aplicar diferentes abordagens.


fonte: https://www.facebook.com/datahackersoficial/about/

Neste caso vamos construir um modelo para prever o salário de um cientista de dados dado um conjunto de respostas

1.1 Descricao do problema

Considerando que as pessoas que responderam o questionario sao cientistas de dados, vamos utilizar estes dados para estimar qual seria o salário e um cientista de dados baseado em algumas perguntas do questionario. Nossa variável resposta será:

Y = salário de um cientista de dados

1.2 Por que um modelo para prever salários?

Imagine que um departamento de RH esteja interessado em conhecer o valor de mercado de um cientista de dados, ou ainda que deseje saber quais as skills mais importantes para contratação. Um modelo de Machine Learning pode ajudar a refletir sobre essas questões

1.3 Dados Fornecidos

Leitura dos dados e arrumar nomes de colunas

# read dataset
dataset <- read_csv("datahackers-survey-2019-anonymous-responses.csv")

# fix colnames
dataset <- 
  dataset %>% 
  janitor::clean_names()

Algumas restrições impostas aos dados:

  • pesquisa foi conduzida de forma online durante o mês de Novembro de 2019
  • dataset foi anonimizado
  • remover alguns outliers que poderiam identificar o entrevistado e, portanto, nem todos os dados coletados na pesquisa estarão disponíveis aqui
  • Estados com menor incidência de resposta, como aqueles das regiões Norte, Nordeste e Centro-Oeste terão apenas sua região indicada no dataset (tambem como consequencia da anonimização)
  • As perguntas cujas respostas são multi-valoradas ocupam mais de uma coluna no dataset
  • Categorias foram convertidas para dummie

Conferir quantidade de opcoes de resposta por pergunta que tenha mais de uma resposta (ordenado do maior para o menor):

(
  MORE_QUESTIONS <- 
    dataset %>% 
    colnames() %>%
    str_extract("(p|d)[0-9]{1,}") %>% 
    table() %>% 
    .[.>1] %>% 
    sort(decreasing = T)
)
## .
## p26 p20 p27 p21 p28 p33 p30 p34 p23 p24 p25 p31 p35 
##  24  21  16  13  12  11  10  10   7   7   7   6   2

Tabela de perguntas de múltipla seleção com maior quantidade de respostas:

dataset %>% 
  select(str_which(colnames(dataset), paste0(names(MORE_QUESTIONS), collapse = "|"))) %>%
  select_if(is.numeric) %>% 
  map_df(sum) %>% 
  gather() %>% 
  arrange(-value) %>% 
  separate(key, c("pergunta", "resposta"),  "_", extra = "merge") %>% 
  kable2(width = NULL)
pergunta resposta value
p31 data_hackers_blog 1195
p34 udemy 1125
p31 data_hackers_podcast 1096
p33 youtube_channels 1014
p31 weekly_newsletter 878
p23 sql 834
p21 python 784
p33 abroad_blogs 780
p33 meetups_and_events 762
p23 sheets 758
p31 slack_channel 728
p21 sql 714
p34 coursera 693
p24 sql 681
p33 other_brasilian_blogs 675
p34 udacity 527
p20 linear_regression 524
p33 telegram_groups 476
p33 abroad_podcasts 452
p20 decision_tree 441
p25 aws 412
p20 logistic_regression 406
p27 microsoft_powerbi 393
p34 data_camp 392
p33 whatsapp_groups 385
p24 planilhas 384
p23 nosql 377
p20 cluster_analysis 368
p26 mysql 366
p20 random_forest 359
p26 postgresql 345
p33 twitter 341
p26 sql_server 334
p23 nlp 330
p21 r 318
p34 kaggle_learn 316
p34 height 301
p34 edx 294
p28 sql_stored_procedures 293
p31 do_not_know_data_hackers 275
p20 neural_networks 267
p20 nlp 252
p34 other 238
p25 gcp 225
p20 bayesian_inference 224
p26 oracle 221
p27 tableau 209
p26 mongodb 207
p28 other 205
p20 no_listed_methods 192
p25 azure 191
p26 s3 189
p20 svms 180
p27 no_bi_tool_at_work 179
p20 gradient_boosted_machines 177
p28 pentaho 170
p20 ensemble 169
p34 online_courses 168
p33 other 166
p25 cloud_propria 163
p23 images 160
p28 apache_airflow 156
p25 on_premise_servers 152
p27 metabase 144
p33 only_data_hackers 138
p24 nosql 136
p20 glms 134
p27 google_data_studio 129
p28 siss_sql_server_integration_services 126
p26 elaticsearch 115
p30 postgres_mysql 107
p27 only_excel_gsheets 105
p28 aws_glue 104
p26 sqlite 102
p20 cnns 101
p20 longitudinal_data_analysis 101
p20 rnns 98
p27 qlik_view_qlik_sense 95
p26 other 94
p33 other_slack_channels 93
p30 aws_redshift 92
p21 java 89
p30 microsoft_azure 85
p21 visual_basic_vba 84
p24 nlp 84
p27 other 83
p30 oracle 82
p20 markov_chains 79
p20 joint_analysis 79
p20 survival_analysis 72
p25 other 69
p31 data_hackers_bootcamp 68
p21 c_c_c_number 65
p26 mariadb 64
p34 data_quest 64
p21 scala 62
p21 sas_stata 61
p30 do_not_know 60
p30 google_bigquery 54
p21 php 48
p25 ibm 44
p26 redis 44
p28 talend 42
p26 dynamodb 41
p26 firebase 40
p26 db2 39
p28 ibm_data_stage 39
p28 alteryx 37
p28 oracle_data_integrator 37
p23 videos 36
p26 google_bigtable 36
p30 other 36
p21 dotnet 35
p23 other 35
p26 ms_access 34
p26 hbase 33
p21 matlab 29
p30 teradata 28
p26 cassandra 27
p27 microstrategy 27
p27 redash 26
p20 gans 24
p28 sap_bw_etl 24
p26 aurora 23
p24 imagens 22
p26 neo4j 21
p27 ibm_analytics_cognos 20
p30 ibm 20
p20 hmms 18
p26 sybase 18
p27 superset 17
p27 sap_business_objects 17
p27 looker 15
p28 luigi 15
p21 julia 14
p30 snowflake 14
p24 other 10
p27 oracle_business_intelligence 10
p21 no_listed_languages 8
p24 videos 5
p26 coachdb 5
p26 vertica 5
p26 datomic 3
p27 birst 2

A definição de cada atributo pode ser conferida com mais detalhes em: https://www.kaggle.com/datahackers/pesquisa-data-hackers-2019

Como o objetivo deste kernel é criar um modelo que calcule o salário de um cientista de dados de acordo com suas respostas na pesquisa, será realizada uma pré-seleção de atributos para previsão de salário, pois, não desejamos que o modelo faça distinção de salário por algumas razões como idade e genero.

Indice Pergunda Seleção
P1 Idade? [Mascarada]
P2 Gênero? [Mascarada]
P3 Atualmente você vive no Brasil?
P4 Em que país você vive hoje?
P5 Em que estado você vive hoje? [Mascarada]
P6 Na questão anterior você disse que vive em. Esse é seu estado de origem (onde nasceu ou se formou)?
P7 Qual seu estado de origem?
P8 Qual seu nível de ensino?
P9 Qual sua área de formação?
P10 Qual sua situação atual de trabalho?
P11 A empresa em que você trabalha pertence a qual setor?
P12 A empresa em que você trabalha possui quantos funcionários atualmente?
P13 Você atua como gestor?
P14 Qual das opções abaixo definem melhor seu cargo de trabalho atual como gestor?
P15 Qual das opções abaixo definem melhor seu cargo de trabalho atual?
P16 Qual sua faixa salarial atual? [Mascarada]
P17 Quanto tempo de experiência na área de dados você tem?
P18 Quanto tempo de experiência na área de TI/Engenharia de Software você teve antes de começar a trabalhar na área de dados?
P19 Você se considera um profissional que atua na área de Data Science?
P20 Quais dos métodos listados abaixo você costuma utilizar no trabalho?
P21 Quais das linguagens de programação listadas abaixo você utiliza no trabalho?
P22 Entre as linguagens de programação listadas abaixo, qual é a que você mais utiliza no trabalho? [Mascarada]
P23 Quais das fontes de dados listadas você já analisou no trabalho?
P24 Entre as fontes de dados listadas, quais você utiliza na maior parte do tempo? Selecione no máximo duas opções que você mais utiliza.
P25 Quais das opções de Cloud listadas abaixo você utiliza no trabalho?
P26 Quais dos bancos de dados/fontes de dados listados abaixo você utiliza para consultar informações, e posteriormente analisar, no trabalho?
P27 Quais as Ferramentas de Business Intelligence você utiliza no trabalho?
P28 Quais as tecnologias são utilizadas como ferramenta de ETL no seu trabalho?
P29 Sua organização possui um Data Warehouse?
P30 Qual tecnologia utilizada como plataforma do Data Warehouse?
P31 Quais das iniciativas do Data Hackers que você já acessou/acompanhou?
P32 Entre as iniciativas do Data Hackers qual a sua preferida?
P33 De quais outras formas que você costuma se atualizar no mundo dos dados?
P34 Em quais dessas plataformas listadas abaixo você já iniciou/completou cursos na área de Data Science?
P35 Dentre as plataformas listadas abaixo qual foi a sua preferida para cursos de Data Science?

Além dessas, mais algumas outras colunas:

Indice Pergunda Seleção
D1 Macrorregião em que mora
D2 Macrorregião em que nasceu
D3 Área de formação anonimizada
D4 Setor de mercado anonimizado
D5 Nível de gerência anonimizado
D6 Cargo anonimizado

1.3.1 Aplicar filtros

Primeiramente, vamos conferir quem sao os individuos que nao declararam o salario:

dataset %>% 
  count(p10_job_situation, p16_salary_range) %>% 
  filter(is.na(p16_salary_range)) %>% 
  kable2(width = NULL)
p10_job_situation p16_salary_range n
Desempregado e não estou buscando recolocação NA 3
Desempregado, buscando recolocação NA 69
Somente Estudante (graduação) NA 85
Somente Estudante (pós-graduação) NA 36
Trabalho na área Acadêmica/Pesquisador NA 45

Como não são pessoas que estão no mercado de trabalho, não utilizaremos estes registros para o treinamento do modelo

dataset <- 
  dataset %>% 
  filter(p3_living_in_brasil == 1) %>% 
  filter(!is.na(p16_salary_range)) %>% 
  select(-p3_living_in_brasil)

Aplicando os filtros:

dataset <- 
  dataset %>% 
  select(p8_degreee_level,
         p12_workers_number:p30_teradata,
         p33_telegram_groups:p34_other,
         d3_anonymized_degree_area:d6_anonymized_role)

1.3.2 Transformação na variável resposta

# before fix y
p1 <- 
  plotly::ggplotly(
    dataset %>% 
      count(p16_salary_range) %>% 
      ggplot(aes(x= p16_salary_range, y = n))+
      geom_bar(stat = "identity") +
      theme(axis.text.x = element_text(angle = 60, vjust = 1, hjust = 1))
  )


# Agregar salarios com menor frequencia
dataset <- 
  dataset %>% 
  mutate(p16_salary_range = as.character(p16_salary_range),
         # p16_salary_range = 
         #   case_when(
         #     p16_salary_range == "Menos de R$ 1.000/mês" ~ "Menos de R$ 2.000/mês",
         #     p16_salary_range == "de R$ 1.001/mês a R$ 2.000/mês" ~ "Menos de R$ 2.000/mês",
         #     p16_salary_range == "de R$ 2.001/mês a R$ 3000/mês" ~ "de R$ 2.001/mês a R$ 3.000/mês",
         #     p16_salary_range == "de R$ 12.001/mês a R$ 16.000/mês" ~ "Acima de R$ 12.001/mês",
         #     p16_salary_range == "de R$ 16.001/mês a R$ 20.000/mês" ~ "Acima de R$ 12.001/mês",
         #     p16_salary_range == "de R$ 20.001/mês a R$ 25.000/mês" ~ "Acima de R$ 12.001/mês",
         #     p16_salary_range == "Acima de R$ 25.001/mês" ~ "Acima de R$ 12.001/mês",
         #     TRUE ~ as.character(p16_salary_range)),
         p16_salary_range = ifelse(p16_salary_range == "de R$ 2.001/mês a R$ 3000/mês",
                                   "de R$ 2.001/mês a R$ 3.000/mês", p16_salary_range),
         p16_salary_range = 
           factor(p16_salary_range, 
                  levels = c("Menos de R$ 1.000/mês",
                             "de R$ 1.001/mês a R$ 2.000/mês",
                             "de R$ 2.001/mês a R$ 3.000/mês",
                             "de R$ 3.001/mês a R$ 4.000/mês",
                             "de R$ 4.001/mês a R$ 6.000/mês",
                             "de R$ 6.001/mês a R$ 8.000/mês",
                             "de R$ 8.001/mês a R$ 12.000/mês",
                             "de R$ 12.001/mês a R$ 16.000/mês",
                             "de R$ 16.001/mês a R$ 20.000/mês",
                             "de R$ 20.001/mês a R$ 25.000/mês",
                             "Acima de R$ 25.001/mês"))) 

# after fix y
p2 <- 
  plotly::ggplotly(
    dataset %>% 
      count(p16_salary_range) %>% 
      ggplot(aes(x= p16_salary_range, y = n))+
      geom_bar(stat = "identity") +
      theme(axis.text.x = element_text(angle = 60, vjust = 1, hjust = 1))
  )

plotly::subplot(p1, p2)

2 Resumir/Analisar Dados

Uma primeira impressão dos dados pode ser obtida com o pacote DataExplorer:

create_report(dataset, y = "p16_salary_range")

Algumas informações sobre os dados:

introduce(dataset) %>% gather() %>% kable2()
key value
rows 1506
columns 148
discrete_columns 10
continuous_columns 138
all_missing_columns 0
total_missing_values 3060
complete_rows 9
total_observations 222888
memory_usage 1817416

De forma visual:

plot_intro(dataset)

Na verdade a maioria de colunas do tipo Continuous ocorre porque as respostas de múltiplas escolhas foram transformadas em dummie

2.1 Limpeza dos dados

Formato e limpeza

2.1.1 Estrutura dos dados

Representação da estrutura dos dados:

visdat::vis_dat(dataset)

2.1.2 Dados ausentes

Colunas com dados ausentes:

plot_missing(dataset, missing_only = T)

A ação executada para os registros de NA será remover colunas p29_have_data_warehouse, p22_most_used_proggraming_languages,d5_anonymized_manager_level, d6_anonymized_role, d4_anonymized_market_sector e d3_anonymized_degree_area inteiras. Vamos supor que não sejam importante no ajuste desse modelo.

Além disso vamos remover todas as linhas restantes com NA e avaliar o impacto no tamanho do dataset:

nlim_antes <- nrow(dataset)

dataset <- 
  dataset %>%
  select(-p29_have_data_warehouse, 
         -p22_most_used_proggraming_languages, 
         -d5_anonymized_manager_level, 
         -d6_anonymized_role,
         -d4_anonymized_market_sector,
         -d3_anonymized_degree_area) %>%
  na.omit()

Uma diminuição de apenas 100% no numero de linhas do dataset

2.1.3 Colunas com baixa variabiliadde

ncol_antes <- ncol(dataset)

n_zeros <- dataset %>% map_dbl(~sum(.x == 0)/ nrow(dataset))
n_zeros <- names(n_zeros[n_zeros > 0.9])

col_zeros <- n_zeros %>% str_extract("(p|d)[0-9]{1,}") %>% unique()
col_zeros <- colnames(dataset)[colnames(dataset) %>% str_which(paste0(col_zeros, collapse = "|"))]

dataset$p20_datascience   <- dataset %>% select(starts_with("p20")) %>% apply(1, sum)
dataset$p21_prog_language <- dataset %>% select(starts_with("p21")) %>% apply(1, sum)
dataset$p25_cloud         <- dataset %>% select(starts_with("p25")) %>% apply(1, sum)
dataset$p26_databases     <- dataset %>% select(starts_with("p26")) %>% apply(1, sum)
dataset$p27_bi            <- dataset %>% select(starts_with("p27")) %>% apply(1, sum)
dataset$p28_etl           <- dataset %>% select(starts_with("p28")) %>% apply(1, sum)
# dataset$p33_comunity      <- dataset %>% select(starts_with("p33")) %>% apply(1, function(x){ifelse(sum(x)!=0, 1, 0)})
dataset$p34_extra_study   <- dataset %>% select(starts_with("p34")) %>% apply(1, sum)

dataset <- 
  dataset %>% 
  select(-one_of(colnames(dataset)[str_which(colnames(dataset), paste0(col_zeros, collapse = "|"))]))

Uma diminuição de 128 colunas do dataset

2.1.4 Atributos ordinais

dataset <- 
  dataset %>% 
  mutate(p8_degreee_level= 
           case_when(p8_degreee_level == "Prefiro não informar" ~ 0,
                     p8_degreee_level == "Não tenho graduação formal" ~ 0,
                     p8_degreee_level == "Estudante de Graduação" ~ 1,
                     p8_degreee_level == "Graduação/Bacharelado" ~ 2,
                     p8_degreee_level == "Pós-graduação" ~ 3,
                     p8_degreee_level == "Mestrado" ~ 3,
                     p8_degreee_level == "Doutorado ou Phd" ~ 4,
           ),
         p12_workers_number = 
           case_when(p12_workers_number == "de 1 a 5" ~ 1,
                     p12_workers_number == "de 6 a 10" ~ 2,
                     p12_workers_number == "de 11 a 50" ~ 3,
                     p12_workers_number == "de 51 a 100" ~ 4,
                     p12_workers_number == "de 101 a 500" ~ 5,
                     p12_workers_number == "de 501 a 1000" ~ 6,
                     p12_workers_number == "de 1001 a 3000" ~ 7,
                     p12_workers_number == "Acima de 3000" ~ 8),
         p17_time_experience_data_science = 
           case_when(str_detect(p17_time_experience_data_science, "Não")~0,
                     p17_time_experience_data_science == "Menos de 1 ano" ~ 1,
                     p17_time_experience_data_science == "de 1 a 2 anos" ~ 2,
                     p17_time_experience_data_science == "de 2 a 3 anos" ~ 3,
                     p17_time_experience_data_science == "de 4 a 5 anos" ~ 4,
                     p17_time_experience_data_science == "de 6 a 10 anos" ~ 5,
                     p17_time_experience_data_science == "Mais de 10 anos" ~ 6),
         p18_time_experience_before = 
           case_when(str_detect(p18_time_experience_before, "Não")~0,
                     p18_time_experience_before== "Menos de 1 ano"~1,
                     p18_time_experience_before== "de 1 a 2 anos"~2,
                     p18_time_experience_before== "de 2 a 3 anos"~3,
                     p18_time_experience_before== "de 4 a 5 anos"~4,
                     p18_time_experience_before== "de 6 a 10 anos"~5,
                     p18_time_experience_before== "Mais de 10 anos"~6),
         p16_salary_range = as.numeric(p16_salary_range)
  ) %>% 
  select(p16_salary_range, everything())

2.2 Estatisticas descritivas

dataset %>% 
  select_if(is.numeric) %>% 
  GGally::ggpairs(upper = list(continuous = GGally::wrap("cor", method = "spearman")))

3 Modelos

3.1 Separar dados de treino/validacao/teste

set.seed(123)
trainIndex <- createDataPartition(dataset$p16_salary_range, p = .8, list = FALSE)
ttrain <- dataset[trainIndex,]
ttest <- dataset[-trainIndex,]

Parametros de controle do ajuste:

trControl <- trainControl(method = "cv",
                           number = 5)

3.2 Baseline - Modelo de Regressão Linear Múltipla (Stepwise)

model_lm = train(
  p16_salary_range ~ .,
  data = dataset,
  method = "lmStepAIC", 
  preProc = c("center", "scale", "YeoJohnson"),
  trControl = trControl
)
## Start:  AIC=1012.5
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p27_bi + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p25_cloud                         1      0.35 2728.1 1010.6
## - p27_bi                            1      1.18 2729.0 1011.0
## - p34_extra_study                   1      3.07 2730.8 1011.9
## - p28_etl                           1      3.64 2731.4 1012.1
## <none>                                          2727.8 1012.5
## - p26_databases                     1      5.01 2732.8 1012.7
## - p19_is_data_science_professional  1      5.17 2732.9 1012.8
## - p21_prog_language                 1      6.39 2734.2 1013.3
## - p20_datascience                   1     57.35 2785.1 1035.6
## - p18_time_experience_before        1    131.34 2859.1 1067.2
## - p12_workers_number                1    143.23 2871.0 1072.2
## - p13_manager                       1    230.93 2958.7 1108.4
## - p8_degreee_level                  1    300.66 3028.4 1136.5
## - p17_time_experience_data_science  1    369.81 3097.6 1163.7
## 
## Step:  AIC=1010.65
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p26_databases + p27_bi + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p27_bi                            1      1.47 2729.6 1009.3
## - p34_extra_study                   1      3.15 2731.3 1010.0
## - p28_etl                           1      3.93 2732.1 1010.4
## <none>                                          2728.1 1010.6
## - p19_is_data_science_professional  1      4.86 2733.0 1010.8
## - p26_databases                     1      5.84 2734.0 1011.2
## - p21_prog_language                 1      6.28 2734.4 1011.4
## - p20_datascience                   1     57.89 2786.0 1034.0
## - p18_time_experience_before        1    131.96 2860.1 1065.6
## - p12_workers_number                1    143.21 2871.3 1070.3
## - p13_manager                       1    233.28 2961.4 1107.5
## - p8_degreee_level                  1    301.09 3029.2 1134.8
## - p17_time_experience_data_science  1    369.95 3098.1 1161.9
## 
## Step:  AIC=1009.3
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p26_databases + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p34_extra_study                   1      3.41 2733.0 1008.8
## - p19_is_data_science_professional  1      3.61 2733.2 1008.9
## <none>                                          2729.6 1009.3
## - p28_etl                           1      4.93 2734.5 1009.5
## - p21_prog_language                 1      6.00 2735.6 1009.9
## - p26_databases                     1      6.98 2736.6 1010.4
## - p20_datascience                   1     57.58 2787.2 1032.5
## - p18_time_experience_before        1    130.86 2860.4 1063.7
## - p12_workers_number                1    146.66 2876.3 1070.4
## - p13_manager                       1    236.52 2966.1 1107.4
## - p8_degreee_level                  1    299.86 3029.4 1132.9
## - p17_time_experience_data_science  1    375.30 3104.9 1162.5
## 
## Step:  AIC=1008.8
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p26_databases + p28_etl
## 
##                                    Df Sum of Sq    RSS    AIC
## - p19_is_data_science_professional  1      3.72 2736.7 1008.4
## <none>                                          2733.0 1008.8
## - p28_etl                           1      5.06 2738.1 1009.0
## - p21_prog_language                 1      5.69 2738.7 1009.3
## - p26_databases                     1      7.05 2740.1 1009.9
## - p20_datascience                   1     64.99 2798.0 1035.1
## - p18_time_experience_before        1    129.75 2862.8 1062.7
## - p12_workers_number                1    147.80 2880.8 1070.3
## - p13_manager                       1    235.81 2968.8 1106.5
## - p8_degreee_level                  1    298.82 3031.8 1131.8
## - p17_time_experience_data_science  1    372.81 3105.8 1160.9
## 
## Step:  AIC=1008.44
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p20_datascience + p21_prog_language + p26_databases + p28_etl
## 
##                                    Df Sum of Sq    RSS    AIC
## - p28_etl                           1      2.54 2739.3 1007.6
## <none>                                          2736.7 1008.4
## - p26_databases                     1      6.54 2743.3 1009.3
## - p21_prog_language                 1     16.32 2753.1 1013.6
## - p20_datascience                   1     61.56 2798.3 1033.2
## - p18_time_experience_before        1    132.63 2869.4 1063.5
## - p12_workers_number                1    150.25 2887.0 1070.8
## - p13_manager                       1    241.11 2977.8 1108.2
## - p8_degreee_level                  1    298.76 3035.5 1131.3
## - p17_time_experience_data_science  1    374.88 3111.6 1161.1
## 
## Step:  AIC=1007.56
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p20_datascience + p21_prog_language + p26_databases
## 
##                                    Df Sum of Sq    RSS    AIC
## <none>                                          2739.3 1007.6
## - p26_databases                     1     11.82 2751.1 1010.8
## - p21_prog_language                 1     13.80 2753.1 1011.6
## - p20_datascience                   1     63.63 2802.9 1033.2
## - p18_time_experience_before        1    134.04 2873.3 1063.1
## - p12_workers_number                1    150.11 2889.4 1069.8
## - p13_manager                       1    238.80 2978.1 1106.3
## - p8_degreee_level                  1    299.00 3038.3 1130.4
## - p17_time_experience_data_science  1    384.17 3123.4 1163.7
## Start:  AIC=1020.56
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p27_bi + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p19_is_data_science_professional  1      0.05 2746.6 1018.6
## - p28_etl                           1      0.17 2746.7 1018.6
## - p25_cloud                         1      1.36 2747.9 1019.2
## - p27_bi                            1      1.87 2748.4 1019.4
## - p34_extra_study                   1      2.33 2748.8 1019.6
## <none>                                          2746.5 1020.6
## - p26_databases                     1      5.59 2752.1 1021.0
## - p21_prog_language                 1     24.63 2771.1 1029.3
## - p20_datascience                   1     48.34 2794.8 1039.6
## - p12_workers_number                1    148.32 2894.8 1082.0
## - p18_time_experience_before        1    164.15 2910.7 1088.6
## - p13_manager                       1    191.30 2937.8 1099.8
## - p8_degreee_level                  1    278.36 3024.9 1135.0
## - p17_time_experience_data_science  1    372.50 3119.0 1172.0
## 
## Step:  AIC=1018.59
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p20_datascience + p21_prog_language + p25_cloud + p26_databases + 
##     p27_bi + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p28_etl                           1      0.25 2746.8 1016.7
## - p25_cloud                         1      1.73 2748.3 1017.4
## - p27_bi                            1      2.29 2748.8 1017.6
## - p34_extra_study                   1      2.30 2748.9 1017.6
## <none>                                          2746.6 1018.6
## - p26_databases                     1      5.53 2752.1 1019.0
## - p21_prog_language                 1     29.27 2775.8 1029.4
## - p20_datascience                   1     50.88 2797.4 1038.7
## - p12_workers_number                1    148.66 2895.2 1080.2
## - p18_time_experience_before        1    164.52 2911.1 1086.8
## - p13_manager                       1    192.18 2938.8 1098.2
## - p8_degreee_level                  1    278.76 3025.3 1133.2
## - p17_time_experience_data_science  1    373.44 3120.0 1170.3
## 
## Step:  AIC=1016.7
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p20_datascience + p21_prog_language + p25_cloud + p26_databases + 
##     p27_bi + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p25_cloud                         1      2.13 2748.9 1015.6
## - p34_extra_study                   1      2.33 2749.2 1015.7
## - p27_bi                            1      3.02 2749.8 1016.0
## <none>                                          2746.8 1016.7
## - p26_databases                     1      6.60 2753.4 1017.6
## - p21_prog_language                 1     29.11 2775.9 1027.4
## - p20_datascience                   1     50.79 2797.6 1036.8
## - p12_workers_number                1    148.41 2895.2 1078.2
## - p18_time_experience_before        1    165.72 2912.5 1085.3
## - p13_manager                       1    192.47 2939.3 1096.4
## - p8_degreee_level                  1    279.17 3026.0 1131.4
## - p17_time_experience_data_science  1    376.70 3123.5 1169.7
## 
## Step:  AIC=1015.63
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p20_datascience + p21_prog_language + p26_databases + p27_bi + 
##     p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p34_extra_study                   1      2.60 2751.5 1014.8
## <none>                                          2748.9 1015.6
## - p27_bi                            1      5.00 2753.9 1015.8
## - p26_databases                     1     10.48 2759.4 1018.2
## - p21_prog_language                 1     26.98 2775.9 1025.4
## - p20_datascience                   1     53.28 2802.2 1036.8
## - p12_workers_number                1    147.33 2896.3 1076.6
## - p18_time_experience_before        1    165.05 2914.0 1084.0
## - p13_manager                       1    193.00 2941.9 1095.5
## - p8_degreee_level                  1    280.58 3029.5 1130.8
## - p17_time_experience_data_science  1    377.05 3126.0 1168.7
## 
## Step:  AIC=1014.77
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p20_datascience + p21_prog_language + p26_databases + p27_bi
## 
##                                    Df Sum of Sq    RSS    AIC
## <none>                                          2751.5 1014.8
## - p27_bi                            1      5.10 2756.6 1015.0
## - p26_databases                     1     10.67 2762.2 1017.4
## - p21_prog_language                 1     26.24 2777.8 1024.2
## - p20_datascience                   1     58.76 2810.3 1038.3
## - p12_workers_number                1    147.86 2899.4 1075.9
## - p18_time_experience_before        1    164.59 2916.1 1082.8
## - p13_manager                       1    191.93 2943.5 1094.1
## - p8_degreee_level                  1    283.42 3035.0 1131.0
## - p17_time_experience_data_science  1    374.75 3126.3 1166.8
## Start:  AIC=1011.22
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p27_bi + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p27_bi                            1      0.32 2725.2 1009.4
## - p28_etl                           1      2.27 2727.2 1010.2
## - p25_cloud                         1      2.95 2727.9 1010.5
## - p19_is_data_science_professional  1      3.44 2728.3 1010.8
## - p34_extra_study                   1      4.34 2729.2 1011.1
## <none>                                          2724.9 1011.2
## - p21_prog_language                 1      4.64 2729.6 1011.3
## - p26_databases                     1      4.68 2729.6 1011.3
## - p20_datascience                   1     43.27 2768.2 1028.2
## - p12_workers_number                1    138.33 2863.2 1068.9
## - p13_manager                       1    154.43 2879.3 1075.7
## - p18_time_experience_before        1    157.58 2882.5 1077.0
## - p8_degreee_level                  1    327.34 3052.2 1145.9
## - p17_time_experience_data_science  1    332.26 3057.2 1147.9
## 
## Step:  AIC=1009.37
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p28_etl                           1      2.66 2727.9 1008.5
## - p19_is_data_science_professional  1      3.13 2728.4 1008.8
## - p25_cloud                         1      3.24 2728.5 1008.8
## - p34_extra_study                   1      4.39 2729.6 1009.3
## - p21_prog_language                 1      4.49 2729.7 1009.4
## <none>                                          2725.2 1009.4
## - p26_databases                     1      5.12 2730.3 1009.6
## - p20_datascience                   1     43.04 2768.3 1026.2
## - p12_workers_number                1    140.12 2865.3 1067.8
## - p13_manager                       1    155.00 2880.2 1074.0
## - p18_time_experience_before        1    157.26 2882.5 1075.0
## - p8_degreee_level                  1    327.04 3052.3 1143.9
## - p17_time_experience_data_science  1    337.53 3062.8 1148.1
## 
## Step:  AIC=1008.54
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p19_is_data_science_professional  1      1.69 2729.6 1007.3
## - p25_cloud                         1      4.27 2732.2 1008.4
## - p21_prog_language                 1      4.39 2732.3 1008.5
## - p34_extra_study                   1      4.39 2732.3 1008.5
## <none>                                          2727.9 1008.5
## - p26_databases                     1      8.32 2736.2 1010.2
## - p20_datascience                   1     42.13 2770.0 1025.0
## - p12_workers_number                1    139.79 2867.7 1066.8
## - p13_manager                       1    154.17 2882.1 1072.8
## - p18_time_experience_before        1    160.12 2888.0 1075.3
## - p8_degreee_level                  1    326.07 3054.0 1142.6
## - p17_time_experience_data_science  1    349.77 3077.7 1151.9
## 
## Step:  AIC=1007.29
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p20_datascience + p21_prog_language + p25_cloud + p26_databases + 
##     p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p25_cloud                         1      2.76 2732.3 1006.5
## <none>                                          2729.6 1007.3
## - p34_extra_study                   1      4.83 2734.4 1007.4
## - p26_databases                     1      7.86 2737.4 1008.8
## - p21_prog_language                 1     11.15 2740.7 1010.2
## - p20_datascience                   1     40.53 2770.1 1023.0
## - p12_workers_number                1    142.43 2872.0 1066.6
## - p18_time_experience_before        1    162.72 2892.3 1075.1
## - p13_manager                       1    163.20 2892.8 1075.3
## - p8_degreee_level                  1    324.87 3054.4 1140.8
## - p17_time_experience_data_science  1    349.33 3078.9 1150.4
## 
## Step:  AIC=1006.51
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p20_datascience + p21_prog_language + p26_databases + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## <none>                                          2732.3 1006.5
## - p34_extra_study                   1      5.12 2737.5 1006.8
## - p21_prog_language                 1      8.56 2740.9 1008.3
## - p26_databases                     1     13.11 2745.4 1010.3
## - p20_datascience                   1     45.28 2777.6 1024.3
## - p12_workers_number                1    141.85 2874.2 1065.5
## - p18_time_experience_before        1    162.68 2895.0 1074.2
## - p13_manager                       1    162.82 2895.2 1074.2
## - p8_degreee_level                  1    324.69 3057.0 1139.8
## - p17_time_experience_data_science  1    348.71 3081.0 1149.2
## Start:  AIC=1037.96
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p27_bi + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p26_databases                     1      0.09 2785.8 1036.0
## - p34_extra_study                   1      1.76 2787.4 1036.7
## - p28_etl                           1      1.78 2787.4 1036.7
## - p27_bi                            1      3.57 2789.2 1037.5
## <none>                                          2785.7 1038.0
## - p19_is_data_science_professional  1      6.64 2792.3 1038.8
## - p25_cloud                         1      8.22 2793.9 1039.5
## - p21_prog_language                 1      9.72 2795.4 1040.2
## - p20_datascience                   1     64.34 2850.0 1063.5
## - p12_workers_number                1    126.93 2912.6 1089.6
## - p18_time_experience_before        1    169.68 2955.3 1107.2
## - p13_manager                       1    185.90 2971.6 1113.7
## - p8_degreee_level                  1    288.58 3074.2 1154.6
## - p17_time_experience_data_science  1    355.91 3141.6 1180.7
## 
## Step:  AIC=1036
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p27_bi + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p28_etl                           1      1.68 2787.4 1034.7
## - p34_extra_study                   1      1.74 2787.5 1034.8
## - p27_bi                            1      3.48 2789.2 1035.5
## <none>                                          2785.8 1036.0
## - p19_is_data_science_professional  1      6.55 2792.3 1036.8
## - p25_cloud                         1      8.32 2794.1 1037.6
## - p21_prog_language                 1     10.61 2796.4 1038.6
## - p20_datascience                   1     65.31 2851.1 1061.9
## - p12_workers_number                1    127.09 2912.8 1087.7
## - p18_time_experience_before        1    171.17 2956.9 1105.8
## - p13_manager                       1    185.81 2971.6 1111.7
## - p8_degreee_level                  1    288.84 3074.6 1152.8
## - p17_time_experience_data_science  1    355.88 3141.6 1178.8
## 
## Step:  AIC=1034.73
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p27_bi + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p34_extra_study                   1      1.70 2789.2 1033.5
## - p27_bi                            1      4.62 2792.1 1034.7
## <none>                                          2787.4 1034.7
## - p19_is_data_science_professional  1      5.33 2792.8 1035.0
## - p21_prog_language                 1      9.85 2797.3 1037.0
## - p25_cloud                         1     10.18 2797.6 1037.1
## - p20_datascience                   1     66.29 2853.7 1061.0
## - p12_workers_number                1    126.69 2914.1 1086.2
## - p18_time_experience_before        1    176.03 2963.5 1106.5
## - p13_manager                       1    184.90 2972.3 1110.1
## - p8_degreee_level                  1    288.80 3076.2 1151.4
## - p17_time_experience_data_science  1    363.88 3151.3 1180.5
## 
## Step:  AIC=1033.46
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p27_bi
## 
##                                    Df Sum of Sq    RSS    AIC
## <none>                                          2789.2 1033.5
## - p27_bi                            1      4.67 2793.8 1033.5
## - p19_is_data_science_professional  1      5.57 2794.7 1033.9
## - p21_prog_language                 1      9.48 2798.6 1035.5
## - p25_cloud                         1     10.59 2799.7 1036.0
## - p20_datascience                   1     72.36 2861.5 1062.3
## - p12_workers_number                1    127.03 2916.2 1085.1
## - p18_time_experience_before        1    175.44 2964.6 1104.9
## - p13_manager                       1    183.49 2972.6 1108.2
## - p8_degreee_level                  1    290.48 3079.6 1150.8
## - p17_time_experience_data_science  1    362.68 3151.8 1178.7
## Start:  AIC=1015.21
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p27_bi + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p27_bi                            1      0.00 2733.5 1013.2
## - p28_etl                           1      1.79 2735.3 1014.0
## - p25_cloud                         1      2.01 2735.5 1014.1
## - p21_prog_language                 1      2.97 2736.5 1014.5
## - p26_databases                     1      3.99 2737.5 1015.0
## <none>                                          2733.5 1015.2
## - p19_is_data_science_professional  1      5.03 2738.6 1015.4
## - p34_extra_study                   1      5.74 2739.3 1015.7
## - p20_datascience                   1     48.83 2782.4 1034.5
## - p18_time_experience_before        1    136.91 2870.4 1072.0
## - p12_workers_number                1    137.90 2871.4 1072.5
## - p13_manager                       1    236.08 2969.6 1113.0
## - p17_time_experience_data_science  1    299.73 3033.3 1138.5
## - p8_degreee_level                  1    369.41 3102.9 1165.8
## 
## Step:  AIC=1013.21
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p28_etl                           1      1.80 2735.3 1012.0
## - p25_cloud                         1      2.01 2735.5 1012.1
## - p21_prog_language                 1      2.98 2736.5 1012.5
## - p26_databases                     1      4.01 2737.6 1013.0
## <none>                                          2733.5 1013.2
## - p19_is_data_science_professional  1      5.59 2739.1 1013.7
## - p34_extra_study                   1      5.74 2739.3 1013.7
## - p20_datascience                   1     48.90 2782.4 1032.6
## - p18_time_experience_before        1    137.07 2870.6 1070.1
## - p12_workers_number                1    139.07 2872.6 1071.0
## - p13_manager                       1    236.32 2969.8 1111.0
## - p17_time_experience_data_science  1    302.07 3035.6 1137.4
## - p8_degreee_level                  1    370.15 3103.7 1164.1
## 
## Step:  AIC=1012.01
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p25_cloud                         1      2.50 2737.8 1011.1
## - p21_prog_language                 1      2.84 2738.2 1011.3
## - p19_is_data_science_professional  1      4.08 2739.4 1011.8
## <none>                                          2735.3 1012.0
## - p34_extra_study                   1      6.02 2741.4 1012.7
## - p26_databases                     1      6.10 2741.4 1012.7
## - p20_datascience                   1     47.98 2783.3 1030.9
## - p12_workers_number                1    139.25 2874.6 1069.8
## - p18_time_experience_before        1    140.01 2875.3 1070.1
## - p13_manager                       1    234.95 2970.3 1109.2
## - p17_time_experience_data_science  1    308.54 3043.9 1138.7
## - p8_degreee_level                  1    370.45 3105.8 1162.9
## 
## Step:  AIC=1011.11
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p26_databases + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p19_is_data_science_professional  1      2.12 2740.0 1010.0
## - p21_prog_language                 1      2.78 2740.6 1010.3
## <none>                                          2737.8 1011.1
## - p34_extra_study                   1      6.61 2744.4 1012.0
## - p26_databases                     1      9.62 2747.4 1013.3
## - p20_datascience                   1     49.10 2786.9 1030.5
## - p12_workers_number                1    138.62 2876.4 1068.6
## - p18_time_experience_before        1    140.83 2878.7 1069.5
## - p13_manager                       1    239.47 2977.3 1110.1
## - p17_time_experience_data_science  1    309.83 3047.7 1138.2
## - p8_degreee_level                  1    371.19 3109.0 1162.2
## 
## Step:  AIC=1010.04
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p20_datascience + p21_prog_language + p26_databases + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## <none>                                          2740.0 1010.0
## - p34_extra_study                   1      6.85 2746.8 1011.0
## - p26_databases                     1      8.07 2748.0 1011.6
## - p21_prog_language                 1     11.63 2751.6 1013.1
## - p20_datascience                   1     47.01 2787.0 1028.5
## - p12_workers_number                1    140.89 2880.8 1068.4
## - p18_time_experience_before        1    142.67 2882.6 1069.2
## - p13_manager                       1    245.01 2985.0 1111.2
## - p17_time_experience_data_science  1    309.44 3049.4 1136.9
## - p8_degreee_level                  1    370.76 3110.7 1160.8
## Start:  AIC=1271.18
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p27_bi + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p27_bi                            1      1.10 3439.3 1269.7
## - p28_etl                           1      2.21 3440.4 1270.2
## - p25_cloud                         1      2.93 3441.1 1270.5
## - p26_databases                     1      3.54 3441.7 1270.7
## - p19_is_data_science_professional  1      3.75 3441.9 1270.8
## - p34_extra_study                   1      3.91 3442.1 1270.9
## <none>                                          3438.2 1271.2
## - p21_prog_language                 1     10.44 3448.6 1273.8
## - p20_datascience                   1     65.70 3503.9 1297.7
## - p12_workers_number                1    173.30 3611.5 1343.2
## - p18_time_experience_before        1    188.11 3626.3 1349.4
## - p13_manager                       1    248.19 3686.4 1374.2
## - p8_degreee_level                  1    389.68 3827.9 1430.9
## - p17_time_experience_data_science  1    431.88 3870.1 1447.4
## 
## Step:  AIC=1269.66
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p28_etl + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p28_etl                           1      2.82 3442.1 1268.9
## - p19_is_data_science_professional  1      2.90 3442.2 1268.9
## - p25_cloud                         1      3.33 3442.6 1269.1
## - p34_extra_study                   1      4.01 3443.3 1269.4
## - p26_databases                     1      4.09 3443.4 1269.5
## <none>                                          3439.3 1269.7
## - p21_prog_language                 1     10.09 3449.4 1272.1
## - p20_datascience                   1     65.19 3504.5 1295.9
## - p12_workers_number                1    176.88 3616.2 1343.2
## - p18_time_experience_before        1    187.23 3626.5 1347.5
## - p13_manager                       1    249.67 3688.9 1373.2
## - p8_degreee_level                  1    388.60 3827.9 1428.9
## - p17_time_experience_data_science  1    437.90 3877.2 1448.2
## 
## Step:  AIC=1268.9
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p19_is_data_science_professional + p20_datascience + p21_prog_language + 
##     p25_cloud + p26_databases + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p19_is_data_science_professional  1      1.45 3443.5 1267.5
## - p34_extra_study                   1      4.10 3446.2 1268.7
## - p25_cloud                         1      4.23 3446.3 1268.8
## <none>                                          3442.1 1268.9
## - p26_databases                     1      6.78 3448.9 1269.9
## - p21_prog_language                 1      9.74 3451.8 1271.2
## - p20_datascience                   1     64.18 3506.3 1294.7
## - p12_workers_number                1    177.00 3619.1 1342.4
## - p18_time_experience_before        1    190.71 3632.8 1348.1
## - p13_manager                       1    247.92 3690.0 1371.6
## - p8_degreee_level                  1    388.40 3830.5 1427.9
## - p17_time_experience_data_science  1    449.25 3891.4 1451.6
## 
## Step:  AIC=1267.53
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p20_datascience + p21_prog_language + p25_cloud + p26_databases + 
##     p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## - p25_cloud                         1      2.87 3446.4 1266.8
## - p34_extra_study                   1      4.35 3447.9 1267.4
## <none>                                          3443.5 1267.5
## - p26_databases                     1      6.51 3450.1 1268.4
## - p21_prog_language                 1     19.97 3463.5 1274.2
## - p20_datascience                   1     62.74 3506.3 1292.7
## - p12_workers_number                1    178.92 3622.5 1341.8
## - p18_time_experience_before        1    193.20 3636.8 1347.7
## - p13_manager                       1    256.21 3699.8 1373.6
## - p8_degreee_level                  1    387.89 3831.4 1426.3
## - p17_time_experience_data_science  1    449.24 3892.8 1450.2
## 
## Step:  AIC=1266.79
## .outcome ~ p8_degreee_level + p12_workers_number + p13_manager + 
##     p17_time_experience_data_science + p18_time_experience_before + 
##     p20_datascience + p21_prog_language + p26_databases + p34_extra_study
## 
##                                    Df Sum of Sq    RSS    AIC
## <none>                                          3446.4 1266.8
## - p34_extra_study                   1      4.64 3451.1 1266.8
## - p26_databases                     1     11.64 3458.1 1269.9
## - p21_prog_language                 1     17.10 3463.5 1272.2
## - p20_datascience                   1     67.64 3514.1 1294.0
## - p12_workers_number                1    177.96 3624.4 1340.6
## - p18_time_experience_before        1    192.74 3639.2 1346.7
## - p13_manager                       1    256.36 3702.8 1372.8
## - p8_degreee_level                  1    388.48 3834.9 1425.6
## - p17_time_experience_data_science  1    450.73 3897.1 1449.9
results <- 
  tibble(pred = round(predict(model_lm, newdata = ttest)),
         obs = ttest$p16_salary_range
  )

p1 <- 
results %>% 
  ggplot(aes(x = obs, y = pred))+
  geom_point()+ 
  geom_abline(intercept = 0)+
  scale_x_continuous(limits = c(0, 12))+
  scale_y_continuous(limits = c(0, 12))

p2 <- 
results %>% 
  gather() %>% 
  ggplot(aes(x = value, fill = key))+
  geom_density(alpha = 0.2)

p1 / p2

O R2 do modelo foi: 0.4444

3.3 eXtreme Gradient Boosting - xgb Linear

set.seed(123)

model_xgb = train(
  p16_salary_range ~ .,
  data = dataset,
  method = "xgbLinear", 
  preProc = c("center", "scale", "YeoJohnson"),
  trControl = trControl
)

results <- 
  tibble(pred = round(predict(model_xgb, newdata = ttest)),
         obs = ttest$p16_salary_range
  )

p1 <- 
results %>% 
  ggplot(aes(x = obs, y = pred))+
  geom_point()+ 
  geom_abline(intercept = 0)+
  scale_x_continuous(limits = c(0, 12))+
  scale_y_continuous(limits = c(0, 12))

p2 <- 
results %>% 
  gather() %>% 
  ggplot(aes(x = value, fill = key))+
  geom_density(alpha = 0.2)

p1 / p2

O R2 do modelo foi: 0.8486

4 Modelo Final

Portanto, o modelo final selecionado será o xgbLinear

Vejamos os atributos mais importantes segundo o modelo:

varImp(model_xgb) %>% ggplot()

Resultados interessantes… Convido ao leitor fazer uma interpretação e, se possivel, sugestões de melhorias para o modelo!

5 Próximos passos

Possíveis próximos passos para melhorar o ajuste do modelo:

  • Testar mais modelos
    • Tunning dos modelos
    • Refinar pré-processamento